package cn.js.sip.rat.system.controller;

import cn.js.sip.rat.system.entity.DicDataEntity;
import cn.js.sip.rat.system.page.TableDataInfo;
import cn.js.sip.rat.system.service.SysDicDataService;
import io.swagger.annotations.Api;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * @ClassName: cn.js.sip.rat.system.controller
 * @Description: TODO
 * @author: xuxiaoli
 * @Date: 2020-01-03   20:59
 */
@Api("用户管理")
@Controller
@RequestMapping("system/dic/data")
public class DicDataController extends BaseController {
    private static Logger logger = LoggerFactory.getLogger(DicDataController.class);

    private String prefix = "system/dic/data";

    @Autowired
    private SysDicDataService dictDataService;

    @RequiresPermissions("system:dic:view")
    @GetMapping()
    public String dictData() {
        return prefix + "/data";
    }

    @PostMapping("/list")
    @RequiresPermissions("system:dic:list")
    @ResponseBody
    public TableDataInfo list(DicDataEntity dictData) {
        return dictDataService.query(dictData);
    }


}
